<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('福利管理')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-west">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-grid"></i> 福利管理
            </div>
            <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i
                        class="fa fa-chevron-up"></i></button>
                <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i
                        class="fa fa-chevron-down"></i></button>
                <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i
                        class="fa fa-refresh"></i></button>
            </div>
        </div>
        <div class="ui-layout-content">
            <div id="tree" class="ztree"></div>
        </div>
    </div>
</div>
<div class="ui-layout-center">
    <iframe id="welfare" src="welfare/welcome" scrolling="no" style="border: none;width: 100%;height: 100%"></iframe>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">
    $(function () {
        var panehHidden = false;

        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 260});
        getTreeData();
    });

    function getTreeData() {
        var url = ctx + "welfare/treeData";
        var options = {
            url: url,
            expandLevel: 2,
            onClick: zOnClick
        };
        $.tree.init(options);

        function zOnClick(event, treeId, treeNode) {
            var src = "";
            var pageNum = treeNode.id;
            if (pageNum == 101) {
                //福利地区配置
                src = ctx + "welfare/region/welfareRegionConfig";
            }else if(pageNum == 102){
                //福利类型
                src = ctx + "welfare/region/welfareType";
            }else if(pageNum == 103){
                //福利地区参数配置
                src = ctx + "welfare/region/welfareRegionParameterConfig";
            }else if(pageNum == 105){
                //福利基数
                src = ctx + "welfare/benefitbase";
            }else if(pageNum == 106){
                //福利计算项目
                src = ctx + "welfare/benefititem";
            }else if(pageNum == 108){
                //福利信息
                src = ctx + "welfare/welfareInfo";
            }else if(pageNum == 110){
                //福利开启
                src = ctx + "welfare/welfareOpen";
            }else if(pageNum == 111){
                //福利开启历史
                src = ctx + "welfare/welfareOpenHistory";
            }else if(pageNum == 113){
                //特殊人员登记
                src = ctx + "welfare/tsgjj";
            }else if(pageNum == 115){
                //福利变动
                src = ctx + "welfare/welfareChange";
            }else if(pageNum == 116){
                //福利变动历史数据
                src = ctx + "welfare/welfareChangeHistory";
            }else if(pageNum == 118){
                //社保基数调整
                src = ctx + "welfare/welfarebaseadjustment/socialsecuritybaseadjustment";
            }else if(pageNum == 119){
                //社保基数调整历史
                src = ctx + "welfare/welfarebaseadjustment/socialsecuritybaseadjustmenthistory";
            }else if(pageNum == 120){
                //公积金基数调整
                src = ctx + "welfare/welfarebaseadjustment/accubaseadjustment";
            }else if(pageNum == 121){
                //公积金基数调整
                src = ctx + "welfare/welfarebaseadjustment/accubaseadjustmenthistory";
            }else if(pageNum == 123){
                //福利补缴登记
                src = ctx + "welfare/welfarePayment/welfarePaymentRegister";
            }else if(pageNum == 124){
                //福利补缴历史
                src = ctx + "welfare/welfarePayment/welfarePaymentHistory";
            }else if(pageNum == 126){
                //福利数据导入
                src = ctx + "welfare/welfareImport";
            }else if(pageNum == 128){
                //月福利计算
                src = ctx + "welfare/calculation";
            }else if(pageNum == 129){
                //月福利历史
                src = ctx + "welfare/calculationHistory";
            }

            $("#welfare").attr({
                "src": src
            });
        }
    }
</script>
</body>
</html>